﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using System.Drawing;


namespace JqueryNet.FormControl.FormWebControl
{
    public class JBulletedList : JWebControl
    {
        BulletedList bulletedlist;

        public JBulletedList(BulletedList bulletedlist)
            : base(bulletedlist)
        {
            this.bulletedlist = bulletedlist;
        }

        public override void Attr(string key)
        {
            switch (key.ToLower())
            {
                case "borderwidth":
                    Value = bulletedlist.BorderWidth;
                    return;
                case "bulletimageurl":
                case "imageurl":
                case "image":
                    Value = bulletedlist.BulletImageUrl;
                    return;
                case "class":
                case "css":
                case "cssclass":
                    Value = bulletedlist.CssClass;
                    return;
                case "target":
                    Value = bulletedlist.Target;
                    return;
                case "tooltip":
                    Value = bulletedlist.ToolTip;
                    return;
                case "width":
                    Value = bulletedlist.Width;
                    return;
                case "height":
                    Value = bulletedlist.Height;
                    return;
                default:
                    base.Attr(key); return;
            }

        }

        public override void Attr(string key, string value)
        {
            int b;
            int.TryParse(value, out b);
            switch (key.ToLower())
            {
                case "borderwidth":
                    bulletedlist.BorderWidth = b;
                    return;
                case "bulletimageurl":
                case "imageurl":
                case "image":
                    bulletedlist.BulletImageUrl = value;
                    return;
                case "class":
                case "css":
                case "cssclass":
                    bulletedlist.CssClass = value;
                    return;
                case "target":
                    bulletedlist.Target = value;
                    return;
                case "tooltip":
                    bulletedlist.ToolTip = value;
                    return;
                case "width":
                    bulletedlist.Width = b;
                    return;
                case "height":
                    bulletedlist.Height = b;
                    return;
                default:
                    base.Attr(key); return;
            }
        }
    }
}
